﻿using NLog;
using NLog.Fluent;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Log4NetToCore3.Models
{
    public static class LogManger
    {
        public static Logger log = LogManager.GetCurrentClassLogger();

        public static LogEventInfo GetLogEventInfo(this Content content, NLog.LogLevel logLevel)
        {
            LogEventInfo theEvent = new LogEventInfo(NLog.LogLevel.Debug, "", "Pass my custom value");
            theEvent.Properties["Userid"] = "My custom string";
            return theEvent;
        }
    }

    public class LogContent
    {
        public LogContent(string message)
        {
            Message = message;
        }

        public LogContent(string message, string currentUser)
        {
            Message = message;
            CurrentUser = currentUser;
        }

        /// <summary>
        /// 日志描述信息
        /// </summary>
        public string Message { get; set; }

        /// <summary>
        /// 当前用户
        /// </summary>
        public string CurrentUser { get; set; }
    }
}
